package Common
{
	import flash.display.Bitmap;
	import flash.display.MovieClip;

	public class GameLoading
	{
		public var ui:MovieClip;
		//public var bitmap:Bitmap;
		
		public function GameLoading()
		{
			
		}
		
		public static var instance:GameLoading = null;	
		public static function Instance():GameLoading
		{
			if ( instance == null )
			{
				instance = new GameLoading();
			}
			
			return instance;
		}
		
		public function init( mc:MovieClip ):void
		{
			ui = mc;
			//bitmap = bit;
			
			//ui.addChild( bit );
			//ui.addChild( ui.perText );
			//ui.addChild( ui.desText );
			
			resize();
		}
		
		public function resize():void
		{
			ui.x = 0;
			ui.y = 0;
			
			ui.width = RenderManager.instance.stageWidth + 5;
			ui.height = RenderManager.instance.stageHeight + 5;
		}
		
		public function load():void
		{
			RenderManager.instance.Debug.addChild( ui );
		}
		
		public function unload():void
		{
			RenderManager.instance.Debug.removeChild( ui );
		}
		
		public function loading( des:String , per:int ):void
		{
			ui.setText( des , per );
		}
		
	}
}